﻿Ext.ns('DirectTest', 'DirectTest.App');

DirectTest.App = function() {
    return {
        init: function() {
            Ext.BLANK_IMAGE_URL = '/Content/ext/resources/images/default/s.gif';
            Ext.QuickTips.init();
            Ext.Direct.addProvider(DirectTest.REMOTING_API);
            
            Ext.Direct.on('exception', function(e) {
                Ext.Msg.alert('Direct Exception', e.message);
            });
            
            new Ext.Container({
                renderTo: 'direct-ct',
                layout: 'hbox',
                height: 300,
                layoutConfig: {
                    padding: '5',
                    align: 'stretch',
                    defaultMargins: {left:5,top:5,right:5,bottom:0}
                },
                items: [{
                    xtype: 'simpletestpanel',
                    width: 430
                }, {
                    xtype: 'formtestpanel',
                    width: 310
                }, {
                    xtype: 'fileuploadpanel',
                    width: 310
                }]
            });
            
            new Ext.Container({
                renderTo: 'direct-ct',
                layout: 'hbox',
                height: 300,
                layoutConfig: {
                    padding: '5',
                    align: 'stretch',
                    defaultMargins: {left:5,top:0,right:5,bottom:5}
                },
                items: [{
                    xtype: 'treetestpanel',
                    width: 350
                }, {
                    xtype: 'employeegrid',
                    width: 710
                }]
            });
        }
    }
}();

Ext.onReady(DirectTest.App.init, DirectTest.App);